import Vue from 'vue'
// import VueRouter from 'vue-router'
import VueRouter from './myrouter'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

  const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
]

const router = new VueRouter({
  // mode: 'history',
  // history模式 上线的时候 需要跟后端配合，当前请求的路径是我们前端的路径时  不要返回404返回 我们项目
  //  hash   onhashchange
  // history popstate replacestate
  base: process.env.BASE_URL,
  routes:routes
})

export default router
